package jude.java.money;

import java.io.IOException;
import java.util.Date;

import jude.java.money.migrate.Zencart2Magento;
import jude.java.util.DateUtils;
import jude.java.util.Utils;

public class Money {

	public static void main(String[] args) throws IOException {
		long now = System.currentTimeMillis();
		long t = now + 147 * (3600L*24*1000);
		System.out.println(DateUtils.toString(new Date(t), DateUtils.DEFAULT_DATE_FORMAT));
/*
		Utils.startSystem("zc");
		zc2mt();
//		showCategories();
//		showOptions();
		Utils.closeSystem();
//*/
//		filterImages();
	}
	
	static void showCategories() throws IOException {
		Zencart2Magento migrator = new Zencart2Magento("zc", "zc");
		migrator.showCategories();
	}
	
	static void showOptions() throws IOException {
		Zencart2Magento migrator = new Zencart2Magento("zc", "zc");
		migrator.showOptions();
	}

	static void zc2mt() throws IOException {
		Zencart2Magento m = new Zencart2Magento("zc", "zc");
/* 指定产品自定义属性和可配置属性
		migrator.setOptions(
			new CustomOption[] {
				new CustomOption("Size", new CustomOptionItem[] {
						new CustomOptionItem("US6"),
						new CustomOptionItem("US7"),
						new CustomOptionItem("US8"),
				}),
			}, null
		);
//*/
/* 设置忽略的产品属性
		m.setIgnoredAttributes(false, new String[] {});
//*/
//* 设置产品过滤分类
		m.setFilterCategories(true, true, new String[] {"1136"});
//*/
//* 设置产品属性集, 可配置属性
		m.setAttributeSet(null, false, new String[] {
				"Clothing Size",
				"Women Size",
				"Men's Size",
		});
//*/
//* 设置项目路径和图片选项
		m.setProductImagePath(true, "E:\\Workspaces\\php\\zc\\", "E:\\import\\", 5);
//*/
		m.setOutputPath("E:\\import\\");
		m.setTablePrefix("", "gif_");
		m.migrate();
	}
	
	/** 过滤无用图片 */
	static void filterImages() throws IOException {
		Utils.startSystem("filter");
		Zencart2Magento m = new Zencart2Magento("zc", "zc");
/* 设置产品过滤分类
		m.setFilterCategories(true, "1136");
//*/
//* 设置项目路径和图片选项
		m.setProductImagePath(true, "E:\\php\\备份\\2011-07-26\\2011airmax.com\\", "E:\\import\\", 5);
//*/
		m.setOutputPath("E:\\import\\");
		m.setTablePrefix("", "gif_");
		m.migrate();
		Utils.closeSystem();
	}

	
}
